import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

// 一级路由
import Home from './components/Home'
import Admin from './components/Admin'
import Menu from './components/Menu'
import About from './components/About'
import Login from './components/Login'
import Register from './components/Register'

//二级路由
import Contact from './components/about/Contact'
import Delivery from './components/about/Delivery'
import History from './components/about/History'
import OrderingGuide from './components/about/OrderingGuide'

//三级路由
import LinkMan from './components/about/LinkMan'
import Phone from './components/about/Phone'


const routes=[
    {path:'/',component:Home},
    {path:'/menu',component:Menu},
    {path:'/admin',component:Admin},

    {path:'/about', redirect:'/about/contact', component:About, children:[
        
        {path:'/about/contact',name:'contactLink',component:Contact, children:[
            {path:'/linkman',component:LinkMan},
            {path:'/phone',component:Phone}
        ]},
        {path:'/delivery',name:'deliveryLink',component:Delivery},
        {path:'/history',name:'historyLink',component:History},
        {path:'/orderingGuide',name:'orderingGuideLink',component:OrderingGuide},

    ]},
    {path:'/login',component:Login},
    {path:'/register',component:Register}
]

const router= new VueRouter({
    routes:routes
})

export default router